/**
 * Copyright (c) 2012-2014, Yang Yang <cntototo@gmail.com>
 *
 * This software may be distributed under the terms of the New BSD License.
 * See README for more details.
 */

#include "event.h"

#define LOG_TAG "EVENT"
#include "include.h"
#include "def.h"
#include "log.h"
#include "util.h"
#include "sta.h"

/***********************************************************
 * Local functions
 ***********************************************************
 */

/***********************************************************
 * Glocal functions
 ***********************************************************
 */

enum wfs_internal_err
wfs_process_event(struct wfs_iface *cur_if, enum wfs_event_type evt_type,
		union wfs_event_data *event)
{
	enum wfs_internal_err ret = WFS_INTERNAL_ERR_SUCCESS;

	assert(cur_if);

	switch (evt_type) {
	case EVT_SCAN_RESULTS:
		ret = sta_evt_scan_results(cur_if, event);
		break;
	case EVT_TRIGGER_SCAN:
		ret = sta_evt_trigger_scan(cur_if);
		break;
	default:
		wfs_printf(LOG_ERR, "Unknown event type %d", evt_type);
		break;
	}

	return ret;
}
